package com.sctvcloud.bazhong.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ruihang.generalibrary.ui.adapter.BaseHolderAbsAdapter;
import com.ruihang.generalibrary.ui.util.OnItemInternalClick;
import com.sctvcloud.bazhong.R;
import com.sctvcloud.bazhong.beans.FCityState;
import com.sctvcloud.bazhong.ui.adapter.holder.CityStaChannelHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/7/17 0017.
 */

public class CityStaChannelAdapter extends BaseHolderAbsAdapter<FCityState, CityStaChannelHolder> {
    private OnItemInternalClick onSubscribeClick;

    public OnItemInternalClick getOnSubscribeClick() {
        return onSubscribeClick;
    }

    public void setOnSubscribeClick(OnItemInternalClick click) {
        onSubscribeClick = click;
    }

    public CityStaChannelAdapter(Context context, List<FCityState> list) {
        super(context, list);
    }

    @Override
    public CityStaChannelHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_city_state_channel, parent, false);
        CityStaChannelHolder holder = new CityStaChannelHolder(context, view);
        holder.setInternalClick(this);
        holder.setOnItemInternalClick(onSubscribeClick);
        return holder;
    }
    @Override
    public CityStaChannelAdapter setItemInternalClick(OnItemInternalClick itemInternalClick) {
        super.setItemInternalClick(itemInternalClick);
        return this;
    }
}
